import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'

// 路由配置
const options = {
    routes: [
        {
            path: '/login',
            name: '登录页',
            component: () => import('@/pages/login')
        },
        {
            path: '/showstand',
            name: '登录页',
            component: () => import('@/pages/showstand')
        },
        {
            path: '*',
            name: '404',
            component: () => import('@/pages/exception/404'),
        },
        {
            path: '/403',
            name: '403',
            component: () => import('@/pages/exception/403'),
        },
        {
            path: '/',
            name: '首页',
            component: TabsView,
            redirect: '/login',
            children: [
                {
                    path: 'dashboard',
                    name: '机械在线监控',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'dashboard'
                    },
                    component: BlankView,
                    children: [
                        {
                            path: 'workplace',
                            name: '实时监控',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/dashboard/workplace'),
                        },
                        {
                            path: 'analysis',
                            name: '历史轨迹',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/dashboard/analysis'),
                        }
                    ]
                },
                {
                    path: 'form',
                    name: '机械电子标签管理',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'form',
                        page: {
                            cacheAble: false
                        }
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'basic',
                            name: '电子标签管理',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/form/basic'),
                        },
                    ]
                },
                {
                    path: 'list',
                    name: '历史数据管理',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'table',
                        invisible: true
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'primary',
                            name: '历史数据',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/list/StandardList'),
                        },
                    ]
                },
                {
                    path: 'details',
                    name: '数据分析',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'profile'
                    },
                    component: BlankView,
                    children: [
                        {
                            path: 'basic',
                            name: '按日期统计数量',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/detail/BasicDetail')
                        },
                        {
                            path: 'advance',
                            name: '工作时长统计',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/detail/AdvancedDetail')
                        },
                        {
                            path: 'time-chart',
                            name: '工作时长统计图',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/detail/TimeHistory')
                        },
                        {
                            path: 'history',
                            name: '环境历史数据',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/detail/History')
                        },
                        {
                            path: 'machine/history',
                            name: '机械历史数据',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/detail/MachineHistory')
                        }
                    ]
                },
                {
                    path: 'result',
                    name: '区域管理',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'check-circle-o',
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'success',
                            name: '区域列表',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/result/Success')
                        }
                    ]
                },
                {
                    path: 'emergency',
                    name: '应急管理',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'exclamation-circle-o',
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'index',
                            name: '区域应急管理',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/emergency/index')
                        }
                    ]
                },
                {
                    path: 'components',
                    name: '系统管理员',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'appstore-o'
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'taskCard',
                            name: '管理员列表',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/components/TaskCard')
                        },
                        {
                            path: 'palette',
                            name: '添加管理员',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/components/Palette')
                        }
                    ]
                },
                {
                    path: 'task',
                    name: '任务调度管理',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'interaction'
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'index',
                            name: '任务列表',
                            meta: {
                                authority: {
                                    role: true
                                },
                            },
                            component: () => import('@/pages/task/task')
                        }
                    ]
                },
                {
                    name: "检测机械历史记录",
                    path: 'label',
                    meta: {
                        authority: {
                            role: true
                        },
                        icon: 'table'
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'index',
                            name: "地图",
                            meta: {
                                authority: {
                                    role: true
                                }
                            },
                            component: () => import('@/pages/label/index')
                        }, {
                            path: 'list',
                            name: "机械列表",
                            component: () => import('@/pages/label/list')
                        }
                    ]
                }
            ]
        },
    ]
}

export default options
